﻿using FMStudio.Templates.DesignTool.Application.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FMStudio.Templates.DesignTool.Application.Models
{
    public class FolderItem : ToolboxItem
    {
        #region Fields
        private bool targetChanged;

        private string folderName;
        private string targetFolderName;
        #endregion

        public FolderItem()
            : base(Resources.Folder)
        {
            this.targetChanged = false;
        }

        #region Properties
        [Required]
        public string FolderName
        {
            get { return this.folderName; }
            set
            {
                if (this.folderName != value)
                {
                    this.folderName = value;
                    RaisePropertyChanged("FolderName");
                    if (!this.targetChanged)
                    {
                        this.targetFolderName = value;
                        RaisePropertyChanged("TargetFolderName");
                    }
                }
            }
        }

        [Required]
        public string TargetFolderName
        {
            get { return this.targetFolderName; }
            set
            {
                if (this.targetFolderName != value)
                {
                    this.targetFolderName = value;
                    RaisePropertyChanged("TargetFolderName");
                    this.targetChanged = true;
                }
            }
        }
        #endregion
    }
}
